package com.ruoyi.sevenInterfaces.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.sevenInterfaces.domain.dto.EventTargetDto;
import com.ruoyi.sevenInterfaces.service.SevenInterfacesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description TODO
 * @Author wsl
 * @Date 2025-02-25 9:56
 * @Version 1.0
 */

@RestController
@RequestMapping("/webs")
@Api(tags = "kt提供接口")
public class SevenInterfacesController {

    @Autowired
    private SevenInterfacesService sevenInterfacesService;


    @ApiOperation(value = "获取事件名称下拉列表")
    @GetMapping("/subject/target")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "类型 暂时只提供type=7"),
    })
    public AjaxResult getEventName(@RequestParam("type") Integer type){

        return AjaxResult.success(sevenInterfacesService.getEventName(type));
    }



    @ApiOperation(value = "根据事件名称获取MB 时间")
    @GetMapping("/network/event-info")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "事件名称"),
    })
    public AjaxResult getMbAndDate(@RequestParam("name") String name){

        return AjaxResult.success(sevenInterfacesService.getMbAndDate(name));

    }


    @ApiOperation(value = "关联检索目标名称下拉列表")
    @GetMapping("network/targetname")
    public AjaxResult getTargetName(){
        return AjaxResult.success(sevenInterfacesService.getTargetName());
    }


    @ApiOperation(value = "飞机、 检索")
    @PostMapping("/url/targetDynamicsInfoHistoryByPlan")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "eventTargetDto", value = "请求实体"),
    })
    public TableDataInfo getTargetDynamicsInfoHistoryByPlan( @RequestBody EventTargetDto eventTargetDto){
        return sevenInterfacesService.getTargetDynamicsInfoHistoryByPlan(eventTargetDto);
    }

    @ApiOperation(value = "船、 检索")
    @PostMapping("/url/targetDynamicsInfoHistorByShip")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "eventTargetDto", value = "请求实体"),
    })
    public TableDataInfo getTargetDynamicsInfoHistoryByShip( @RequestBody EventTargetDto eventTargetDto){
        return sevenInterfacesService.getTargetDynamicsInfoHistoryByShip(eventTargetDto);
    }

    @ApiOperation(value = "目标信息数据检索结果")
    @PostMapping("/usrl/target/list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "eventTargetDto", value = "请求实体"),
    })
    public TableDataInfo getTargetInfo(@RequestBody EventTargetDto eventTargetDto){
        return sevenInterfacesService.getTargetInfo(eventTargetDto);
    }

    @ApiOperation(value = "互联网咨询数据")
    @PostMapping("/network/selectWebData")
    public TableDataInfo getWebData(@RequestBody EventTargetDto eventTargetDto){
        return sevenInterfacesService.getWebData(eventTargetDto);
    }
}
